#include <iostream>
#include <vector>
#include <queue>
#include <stack>
using namespace std;


int main() {
    int n, m;
    cin >> n >> m;
    int k = n - m;
    double sum = 0.0;
    while (k--)
    {
        double p;
        cin >> p;
        sum += p;
    }
    double mm = (m + sum) / n;
    double MM = ((m) * 5.0 + sum) / n;
    printf("%.5lf %.5lf", mm, MM);
    return 0;
}

class Solution {
public:
    vector<int> solve(vector<int>& a) {
        // write code here
        int n = a.size();
        stack<int> st;
        bool hash[50001] = { 0 };
        int aa = n;
        vector<int> ret;
        for (auto s : a)
        {
            st.push(s);
            hash[s] = true;
            while (hash[aa])
            {
                aa--;
            }
            while (st.size() && st.top() >= aa)
            {
                ret.push_back(st.top());
                st.pop();
            }
        }
        return ret;
    }
};

#include <cmath>
using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    double ret1 = 1.0;
    for (int i = n; i >= n - m + 1; i--)
    {
        ret1 *= i;
    }
    for (int i = 1; i <= m; i++)
    {
        ret1 /= i;
    }
    double r = pow(0.2, n - m);
    double y = pow(0.8, m);
    printf("%.4lf", ret1 * r * y);
    return 0;
}

const long long N = 2e5 + 10;
int n, l, r;
int vt[N];

long long find(int x)
{
    int left = 0;
    int right = 0;
    long long ret = 0;
    while (right < n)
    {
        while (vt[right] - vt[left] > x)
        {
            left++;
        }
        ret += right - left;
        right++;
    }
    return ret;
}

int main() {
    cin >> n >> l >> r;
    for (int i = 0; i < n; i++)
    {
        cin >> vt[i];
    }
    sort(vt, vt + n);
    cout << find(r) - find(l - 1) << endl;
    return 0;
}

int mod = (1e9 + 7);

int main() {
    int n;
    cin >> n;
    int x = 1;
    int y = 2;
    for (int i = 2; i <= n; i++)
    {
        int xx = x;
        int yy = y;
        x = (2 * yy + 1) % mod;
        y = ((2 * yy) % mod + 2 + xx) % mod;
    }
    cout << x << " " << y << endl;
}


int main() {
    string str;
    cin >> str;
    string ret;
    int n = str.size();
    int left = 0;
    int right = 0;
    while (right < n)
    {
        if (str[right] >= '0' && str[right] <= '9')
        {
            ;
        }
        else
        {
            while (left <= right)
            {
                left++;
            }
        }
        right++;
        if (right - left + 1 > ret.size())
        {
            ret = str.substr(left, right - left);
        }
    }
    cout << ret << endl;
    return 0;
}

class Solution {
public:
    bool board[201][201] = { 0 };
    int dx[4] = { 0,0,1,-1 };
    int dy[4] = { 1,-1,0,0 };
    int n, m;

    void dfs(vector<vector<char> >& grid, int x, int y)
    {
        board[x][y] = true;
        for (int i = 0; i < 4; i++)
        {
            int x1 = x + dx[i];
            int y1 = y + dy[i];
            if (x1 >= 0 && x1 < n && y1 >= 0 && y1 < m && grid[x1][y1] == '1' && !board[x1][y1])
            {
                dfs(grid, x1, y1);
            }
        }
    }

    int solve(vector<vector<char> >& grid) {
        // write code here
        n = grid.size();
        m = grid[0].size();
        queue<pair<int, int>> q;
        int ret = 0;
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < m; j++)
            {
                if (grid[i][j] == '1')
                {
                    q.push({ i,j });
                }
            }
        }
        while (q.size())
        {
            auto [x, y] = q.front();
            q.pop();
            if (grid[x][y] == '1' && !board[x][y])
            {
                ret++;
                dfs(grid, x, y);
            }
        }
        return ret;
    }
};

